﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
   public bool isDebug = false;
   public string JS_Head
   {
      get
      {
         if (Application["DEFAULT_JS_Head"] == null)
         {
            FileInfo FI = new FileInfo(Server.MapPath("/js/head.js"));
            Application["DEFAULT_JS_Head"] = FI.LastWriteTime.ToString("yyyyMMdd_HHmmss");
            return JS_Head;
         }
         else
         {
            return Application["DEFAULT_JS_Head"].ToString();
         }
      }
   }
   public string JS_Foot
   {
      get
      {
         if (Application["DEFAULT_JS_Foot"] == null)
         {
            FileInfo FI = new FileInfo(Server.MapPath("/js/footer.js"));
            Application["DEFAULT_JS_Foot"] = FI.LastWriteTime.ToString("yyyyMMdd_HHmmss");
            return JS_Foot;
         }
         else
         {
            return Application["DEFAULT_JS_Foot"].ToString();
         }
      }
   }
   protected override void OnPreInit(EventArgs e)
   {
      string PageTheme = Typecast.ToString(Request.QueryString["theme"]);
      if (PageTheme.Length > 0)
      {
         Page.Theme = PageTheme;
      }
      else
      {
         Page.Theme = "default";
      }
      base.OnPreInit(e);
   }

   protected void Page_Load(object sender, EventArgs e)
    {
       if (!ActionValidator.ChkValid(ActionValidator.ActionTypeEnum.FailAction))
          Response.Redirect("/support/hacking.html");

       if (Typecast.ToString(Request.QueryString["debug"]).Length > 0)
       {
          isDebug = true;
       }

       if (!isDebug)
       {
          if (Application["DEFAULT_JS_Head"] == null)
          {
          }

          if (Application["DEFAULT_JS_FOOT"] == null)
          {
          }
       }       
    }
   protected void ScriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
   {
      ScriptManager.AsyncPostBackErrorMessage = e.Exception.Message;
   }
}
